3.3 \(\int \frac {A+B \sin (x)}{1-\cos (x)} \, dx\)

Optimal. Leaf size=23 \[ B \log (1-\cos (x))-\frac {A \sin (x)}{1-\cos (x)} \]

[Out]

B*ln(1-cos(x))-A*sin(x)/(1-cos(x))

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {4401, 2648, 2667, 31} \[ B \log (1-\cos (x))-\frac {A \sin (x)}{1-\cos (x)} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Sin[x])/(1 - Cos[x]),x]

[Out]

B*Log[1 - Cos[x]] - (A*Sin[x])/(1 - Cos[x])

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2667

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rule 4401

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

Rubi steps

\begin {align*} \int \frac {A+B \sin (x)}{1-\cos (x)} \, dx &=\int \left (-\frac {A}{-1+\cos (x)}-\frac {B \sin (x)}{-1+\cos (x)}\right ) \, dx\\ &=-\left (A \int \frac {1}{-1+\cos (x)} \, dx\right )-B \int \frac {\sin (x)}{-1+\cos (x)} \, dx\\ &=-\frac {A \sin (x)}{1-\cos (x)}+B \operatorname {Subst}\left (\int \frac {1}{-1+x} \, dx,x,\cos (x)\right )\\ &=B \log (1-\cos (x))-\frac {A \sin (x)}{1-\cos (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 20, normalized size = 0.87 \[ 2 B \log \left (\sin \left (\frac {x}{2}\right )\right )-A \cot \left (\frac {x}{2}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Sin[x])/(1 - Cos[x]),x]

[Out]

-(A*Cot[x/2]) + 2*B*Log[Sin[x/2]]

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 25, normalized size = 1.09 \[ \frac {B \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) - A \cos \relax (x) - A}{\sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(x))/(1-cos(x)),x, algorithm="fricas")

[Out]

(B*log(-1/2*cos(x) + 1/2)*sin(x) - A*cos(x) - A)/sin(x)

________________________________________________________________________________________

giac [A]  time = 1.94, size = 39, normalized size = 1.70 \[ -B \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) + 2 \, B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) - \frac {2 \, B \tan \left (\frac {1}{2} \, x\right ) + A}{\tan \left (\frac {1}{2} \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(x))/(1-cos(x)),x, algorithm="giac")

[Out]

-B*log(tan(1/2*x)^2 + 1) + 2*B*log(abs(tan(1/2*x))) - (2*B*tan(1/2*x) + A)/tan(1/2*x)

________________________________________________________________________________________

maple [A]  time = 0.07, size = 31, normalized size = 1.35 \[ -\frac {A}{\tan \left (\frac {x}{2}\right )}+2 B \ln \left (\tan \left (\frac {x}{2}\right )\right )-B \ln \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sin(x))/(1-cos(x)),x)

[Out]

-A/tan(1/2*x)+2*B*ln(tan(1/2*x))-B*ln(tan(1/2*x)^2+1)

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 19, normalized size = 0.83 \[ B \log \left (\cos \relax (x) - 1\right ) - \frac {A {\left (\cos \relax (x) + 1\right )}}{\sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(x))/(1-cos(x)),x, algorithm="maxima")

[Out]

B*log(cos(x) - 1) - A*(cos(x) + 1)/sin(x)

________________________________________________________________________________________

mupad [B]  time = 2.21, size = 30, normalized size = 1.30 \[ 2\,B\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-\frac {A}{\mathrm {tan}\left (\frac {x}{2}\right )}-B\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(A + B*sin(x))/(cos(x) - 1),x)

[Out]

2*B*log(tan(x/2)) - A/tan(x/2) - B*log(tan(x/2)^2 + 1)

________________________________________________________________________________________

sympy [A]  time = 0.45, size = 27, normalized size = 1.17 \[ - \frac {A}{\tan {\left (\frac {x}{2} \right )}} - B \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} + 2 B \log {\left (\tan {\left (\frac {x}{2} \right )} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(x))/(1-cos(x)),x)

[Out]

-A/tan(x/2) - B*log(tan(x/2)**2 + 1) + 2*B*log(tan(x/2))

________________________________________________________________________________________